export CODE_BASE=/mnt/database/belf
export BELF_HOME=$CODE_BASE/belf-migrate

# shellcheck disable=SC2164
cd $BELF_HOME
git pull
gradle clean
gradle jar -x test
gradle :core:copyLibs
gradle :antlr:copyLibs
gradle :api:copyLibs
gradle :plugins:mysql:copyLibs
gradle :plugins:oracle:copyLibs
gradle :plugins:dameng:copyLibs
gradle :plugins:kingbase:copyLibs
gradle :engine:copyLibs


# shellcheck disable=SC2164
cd $CODE_BASE/belf-base
git pull
gradle clean


# shellcheck disable=SC2164
cd $CODE_BASE/belf-node
git pull
gradle clean


# shellcheck disable=SC2164
cd $BELF_HOME
nohup java -cp "./conf:./libs/*"  belf.migrate.engine.BelfEngine > migrate.log 2>&1 &
